package com.linran.wxpublic.domain.xml;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlElementWrapper;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
import lombok.Data;

import java.util.List;

/**
 * 微信响应
 *
 * @author lin
 * @date 2020-08-19 16:47
 */
@Data
@JsonInclude(value = JsonInclude.Include.NON_NULL)
@JacksonXmlRootElement(localName = "xml")
public class WeChatResponse {
    /**
     * 开发者微信号
     */
    @JacksonXmlProperty(localName = "ToUserName")
    private String toUserName;
    /**
     * 发送方账号(一个OpenID)
     */
    @JacksonXmlProperty(localName = "FromUserName")
    private String fromUserName;
    /**
     * 消息创建时间
     */
    @JacksonXmlProperty(localName = "CreateTime")
    private Long createTime;
    @JacksonXmlProperty(localName = "Content")
    private String content;
    /**
     * 消息类型，文本:text,图片:image,语音:voice,视频:vide,小视频:shortvideo,地理位置:location,连接:link,图文:news,事件:event
     */
    @JacksonXmlProperty(localName = "MsgType")
    private String msgType;
    @JacksonXmlProperty(localName = "Image")
    private WeChatImage weChatImage;
    @JacksonXmlProperty(localName = "ArticleCount")
    private Integer articleCount;
    @JacksonXmlElementWrapper(localName = "Articles")
    @JacksonXmlProperty(localName = "item")
    private List<WeChatArticle> article;
}
